﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SaunaServer.Model.Network;

namespace SaunaServer.Controller.Communication
{
    /// <summary>
    /// Communication Manager Interface
    /// </summary>
    /// <dates>
    /// 29/09/2011 - created by Chiaki Sato
    /// </dates>
    public interface ICommunicationManager
    {
        /// <summary>
        /// Start Server Communication
        /// </summary>
        void StartCommunication();

        /// <summary>
        /// End Server Communication
        /// </summary>
        void EndCommunication();

        /// <summary>
        /// AuthenticateUser
        /// </summary>
        /// <param name="userId">User Id</param>
        /// <param name="password">Password</param>
        /// <param name="userFullName">User full name</param>
        bool AuthenticateUser(string userId, string password, out string userFullName);

        /// <summary>
        /// Create Download Log record
        /// </summary>
        /// <param name="userId">User Id</param>
        /// <param name="fileName">File Name</param>
        /// <param name="dateTime">Download date and time</param>
        void CreateDownloadLogRecord(string userId, string fileName, string dateTime);

        /// <summary>
        /// Get Popular File Ranking
        /// <returns>Popular File Ranking List</returns>
        /// </summary>
        string[,] GetPopularFileRanking();

        /// <summary>
        /// Read Network setting from config file on current directory
        /// </summary>
        /// <returns>NetworkSetting</returns>
        NetworkSetting ReadConfigFile();

        /// <summary>
        /// Read Network setting from config file on specified directory
        /// </summary>
        /// <param name="configDirFileName">config Directory and File Name</param>
        /// <returns>NetworkSetting</returns>
        NetworkSetting ReadConfigFileFromDirectory(string configDirFileName);

        /// <summary>
        /// Write a message to monitor
        /// </summary>
        /// <param name="message">display message</param>
        void WriteMonitorMessage(String message);

    }
}
